<%@page import="cn.yunhe.model.Cate"%>
<%@page import="java.util.List"%>
<%@page import="cn.yunhe.biz.CateBizImpl"%>
<%@page import="cn.yunhe.biz.ICateBiz"%>
<%@page import="cn.yunhe.model.Admin"%>
<%@page import="cn.yunhe.biz.AdminBizImpl"%>
<%@page import="cn.yunhe.biz.IAdminBiz"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	request.setCharacterEncoding("UTF-8");
	
	String name=request.getParameter("username");
	String pwd=request.getParameter("password");
	
	IAdminBiz adminBiz=new AdminBizImpl();
	
	Admin admin=adminBiz.adminLogin(name, pwd);
	
	//获得板块的集合
	ICateBiz cateBiz=new CateBizImpl();
	List<Cate> cates=cateBiz.searchAll();
	
	if(admin!=null){
		session.setAttribute("admin",admin);
		session.setAttribute("cates", cates);
		request.getRequestDispatcher("index.jsp").forward(request, response);
	}else{
		response.sendRedirect("adminLogin.jsp");
	}


%>